package com.yc.cloud.openai.portal;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(scanBasePackages = {"com.yc.cloud"})
@EnableScheduling
@Slf4j
public class OpenAIPortalApplication implements CommandLineRunner {

    // 读取从 pom.xml 注入的版本号
    @Value("${app.version}")
    private String projectVersion;

    public static void main(String[] args) {
        SpringApplication.run(OpenAIPortalApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("应用启动成功,当前版本号: {}", projectVersion);
    }
}
